// @ts-nocheck
/**
 * @Date: 2022-03-10 20:01:52
 * @LastEditors: sailornpg
 * @LastEditTime: 2022-03-14 11:22:01
 * @FilePath: \zhihuReal\model\answersMdl.js
 * @Description: 答案Schema
 */
const {
    Schema
} = require('../db/db')
const mongoose = require('../db/db')
const answerSchema = mongoose.Schema({
    __v: {
        type: Number,
        select: false
    },
    content: {
        type: String,
        required: true
    },
    answerer: {
        type: Schema.Types.ObjectId,
        ref: 'User',
        required: true,
        select: false
    },
    questionId: {
        type: String,
        required: true
    },
    //点赞数
    likeCount: {
        type: Number,
        required: true,
        default: 0
    },
    //踩数
    unlikeCount: {
        type: Number,
        required: true,
        default: 0
    },
    //收藏数
    collectionCount: {
        type: Number,
        required: true,
        default: 0
    }

}, {
    timestamps: true
})
const Answer = mongoose.model('Answer', answerSchema)
module.exports = Answer